load(
    "//tools/build_defs/oss:rn_defs.bzl",
    "ANDROID",
    "APPLE",
    "CXX",
    "react_native_xplat_target",
    "rn_xplat_cxx_library",
    "subdir_glob",
)

rn_xplat_cxx_library(
    name = "components",
    srcs = glob(
        ["**/*.cpp"],
    ),
    headers = glob(
        ["**/*.h"],
    ),
    header_namespace = "",
    exported_headers = subdir_glob(
        [
            ("", "**/*.h"),
        ],
        prefix = "react/cxxcomponents",
    ),
    force_static = True,
    labels = [
        "pfh:ReactNative_CommonInfrastructurePlaceholder",
    ],
    platforms = (APPLE, ANDROID, CXX),
    preprocessor_flags = [
        "-DLOG_TAG=\"ReactNative\"",
        "-DWITH_FBSYSTRACE=1",
    ],
    soname = "libcxxcomponents.$(ext)",
    visibility = ["PUBLIC"],
    deps = [
        "//third-party/glog:glog",
        "//xplat/fbsystrace:fbsystrace",
        "//xplat/folly:memory",
        "//xplat/folly:molly",
        react_native_xplat_target("react/renderer/core:core"),
    ],
)
